% NOTATION


% Mathematics
\newcommand{\reals}{\ensuremath{\mathbb{R}}}
\newcommand{\naturalnumbers}{\ensuremath{\mathbb{N}}}
\newcommand{\positiveints}{\ensuremath{\mathbb{Z}^+}}
\newcommand{\abs}[1]{\ensuremath{\left\lvert #1 \right\rvert}}
\newcommand{\setsize}[1]{\ensuremath{\abs{#1}}}
\newcommand{\floor}[1]{\ensuremath{\left\lfloor #1 \right\rfloor}}
\newcommand{\ceil}[1]{\ensuremath{\left\lceil #1 \right\rceil}}
\newcommand{\hp}{hp}
\newcommand{\bis}{\ensuremath{{\prime\prime}}}
\newcommand{\cartesian}{\prod}
\newcommand{\powerset}[1]{\ensuremath{\mathsf{2}^{#1}}}
\newcommand{\modulo}[2]{\ensuremath{#1\textrm{ mod }#2}}
\newcommand{\myfloor}[1]{\ensuremath{\left\lfloor #1 \right\rfloor}}
\newcommand{\myceil}[1]{\ensuremath{\left\lceil #1 \right\rceil}}
\newcommand{\onetoN}[1]{\ensuremath{\{1,\ldots,#1\}}}
\newcommand{\estimate}[1]{\ensuremath{\widehat{#1}}}
\newcommand{\approximation}[1]{\ensuremath{\overline{#1}}}
\renewcommand{\approximation}[1]{\ensuremath{\estimate{#1}}}
\newcommand{\expectedvalue}[1]{\ensuremath{\mathrm{E}\left\{#1\right\}}}
\newcommand{\stddev}[1]{\ensuremath{\mathrm{D}\left\{#1\right\}}}
\newcommand{\transpose}[1]{\ensuremath{#1^\mathsf{T}}}
\newcommand{\lcm}[1]{\ensuremath{\textrm{lcm}\left(#1\right)}}
\newcommand{\timederivative}[1]{\ensuremath{\dot{#1}}}


\DeclareMathOperator*{\argmin}{arg\,min}

% Algorithms
%\newcommand{\algAssignment}{\ensuremath{\leftarrow}}
\newcommand{\algAssignment}{\ensuremath{:=}}
\renewcommand{\algAssignment}{\ensuremath{\longleftarrow}}
\newcommand{\algWhile}{\textbf{while }}
\newcommand{\algIf}{\textbf{if }}
\newcommand{\algElse}{\textbf{else }}
\newcommand{\algAnd}{\textbf{ and }}
\newcommand{\algList}{\textbf{list }}
\newcommand{\algEmptyList}{\textbf{empty }}

% System model
\newcommand{\period}{\ensuremath{h}}
\newcommand{\periodset}{\ensuremath{\mathbf{H}}}
\newcommand{\task}{\ensuremath{\tau}}
\newcommand{\msg}{\ensuremath{\gamma}}
\newcommand{\application}{\ensuremath{\Lambda}}
\newcommand{\applicationset}{\ensuremath{\mathbf{\Lambda}}}
\newcommand{\taskset}{\ensuremath{\mathbf{T}}}
\newcommand{\msgset}{\ensuremath{\mathbf{\Gamma}}}
\newcommand{\responsetime}[2]{\ensuremath{r_{#1}^{(#2)}}}
\newcommand{\wcrt}{\ensuremath{R}}
\newcommand{\nodeset}{\ensuremath{\mathbf{N}}}
\newcommand{\node}{\ensuremath{N}}

%\newcommand{\mapping}{\ensuremath{m}}
\newcommand{\mapping}{\ensuremath{\textsf{map}}}
\newcommand{\invmap}{\ensuremath{\mapping^{*}}}
%\newcommand{\invmap}{\ensuremath{\overline{\mapping}}}

\newcommand{\bus}{\ensuremath{B}}
\newcommand{\busset}{\ensuremath{\mathbf{B}}}
\newcommand{\linkset}{\ensuremath{\mathbf{L}}}
\newcommand{\indexset}{\ensuremath{\mathcal{I}}}
\newcommand{\reldeadline}{\ensuremath{D}}
\newcommand{\minreldeadline}{\ensuremath{D}^\textrm{min}}
\newcommand{\maxreldeadline}{\ensuremath{D}^\textrm{max}}
\newcommand{\absdeadline}{\ensuremath{d}}
\newcommand{\job}[2]{\ensuremath{\task_{#1}^{(#2)}}} % e.g., \job{ij}{p}
\newcommand{\jobset}{\ensuremath{\mathbf{\Theta}}}
\newcommand{\msginstance}[2]{\ensuremath{\msg_{#1}^{(#2)}}}
%\newcommand{\indexsetC}{\indexset_\textrm{C}}
%\newcommand{\indexsetRT}{\indexset_\textrm{RT}}
\newcommand{\plant}{\ensuremath{P}}
\newcommand{\plants}{\ensuremath{\mathbf{P}}}
%\newcommand{\indexsetplants}{\ensuremath{\mathcal{I}_\plants}}
\newcommand{\exectime}{\ensuremath{c}}
\newcommand{\bcet}[1]{\ensuremath{\exectime_{#1}^\textrm{bc}}}
\newcommand{\wcet}[1]{\ensuremath{\exectime_{#1}^\textrm{wc}}}
\newcommand{\pdf}{\ensuremath{\xi}}
\newcommand{\etpdf}{\ensuremath{\exectime^\textrm{pdf}}}
\newcommand{\interval}[2]{\ensuremath{\left[#1,#2\right]}}
\newcommand{\controlcost}{\ensuremath{J}}
\newcommand{\plantinput}{\ensuremath{\boldsymbol{u}}}
\newcommand{\plantoutput}{\ensuremath{\boldsymbol{y}}}
\newcommand{\plantstate}{\ensuremath{\boldsymbol{x}}}
\newcommand{\disturbance}{\ensuremath{\boldsymbol{v}}}
\newcommand{\measnoise}{\ensuremath{\boldsymbol{e}}}
\newcommand{\weight}{\ensuremath{w}}
\newcommand{\delay}{\ensuremath{\delta}}
\newcommand{\delaySA}{\ensuremath{\delay^\textrm{sa}}}
\newcommand{\delaySC}{\ensuremath{\delay^\textrm{sc}}}
\newcommand{\delayCA}{\ensuremath{\delay^\textrm{ca}}}
\newcommand{\Delay}{\ensuremath{\Delta}}
\newcommand{\DelaySA}{\ensuremath{\Delay^\textrm{sa}}}
\newcommand{\DelaySC}{\ensuremath{\Delay^\textrm{sc}}}
\newcommand{\DelayCA}{\ensuremath{\Delay^\textrm{ca}}}
\newcommand{\DelaySApdf}{\ensuremath{\pdf^\textrm{sa}}}
\newcommand{\DelaySCpdf}{\ensuremath{\pdf^\textrm{sc}}}
\newcommand{\DelayCApdf}{\ensuremath{\pdf^\textrm{ca}}}
\newcommand{\DelaySAapprox}{\ensuremath{\approximation{\Delay}^\textrm{sa}}}
\newcommand{\DelaySApdfapprox}{\ensuremath{\approximation{\pdf}^\textrm{sa}}}
\newcommand{\ordering}{\ensuremath{\sigma}}
\newcommand{\invordering}{\ensuremath{\ordering}^{-1}}
\newcommand{\schedule}{\ensuremath{\Omega}}
\newcommand{\scheduleset}{\ensuremath{\mathbf{\schedule}}}
\newcommand{\busindex}{\textrm{bus}}
\newcommand{\hyperperiod}{\ensuremath{\period_\applicationset}}
\newcommand{\avgdelayweight}{\ensuremath{\alpha}}
\newcommand{\jitterweight}{\ensuremath{\beta}}
\newcommand{\clpimprfact}{\ensuremath{\eta}}
\newcommand{\prio}{\ensuremath{\rho}}
\newcommand{\prioassignment}{\ensuremath{\boldsymbol{\rho}}}
\newcommand{\delayset}[2]{\ensuremath{\mathbf{\Delay}_{#1}^{(#2)}}}
\newcommand{\delaymultiplicity}[2]{\ensuremath{\eta_{\mathbf{\Delay}_{#1}}^{(#2)}}}


% Genetic algorithm
\newcommand{\population}{\ensuremath{\mathbf{\Psi}}}
\newcommand{\nroffsprings}{\ensuremath{n_\textrm{offspr}}}
\newcommand{\mutationprob}{\ensuremath{p_\textrm{mut}}}
\newcommand{\offsprings}{\ensuremath{\population^\textrm{offspr}}}
\newcommand{\crossoverpoint}{\ensuremath{\kappa}}




% For mode changes
\newcommand{\modehyperperiod}[1]{\ensuremath{\period_{#1}}}
\newcommand{\modescheduleperiod}[1]{\ensuremath{\period_{\scheduleset}^{#1}}}
\newcommand{\mode}{\ensuremath{\mathbf{M}}}
%\newcommand{\mode}{\ensuremath{M}}
\newcommand{\mcrtime}{\ensuremath{t_{\textrm{MCR}}}}
\newcommand{\modestarttime}[1]{\ensuremath{t_\textrm{start}^{#1}}}
\newcommand{\modes}{\ensuremath{\mathcal{M}}}
\newcommand{\supermodes}[1]{\ensuremath{\overline{\modes}(#1)}} 
\newcommand{\submodes}[1]{\ensuremath{\underline{\modes}(#1)}}
%\newcommand{\immediatesubmodes}[1]{\ensuremath{\underline{\modes}^{(1)}(#1)}}
%\newcommand{\immediatesupermodes}[1]{\ensuremath{\overline{\modes}^{(1)}(#1)}}
\newcommand{\immediatesubmodes}[1]{\ensuremath{\modes^-(#1)}}
\newcommand{\immediatesupermodes}[1]{\ensuremath{\modes^+(#1)}}
%\newcommand{\topmodes}[1]{\ensuremath{\widehat{#1}}} % #1 = a mode set
\newcommand{\topmodes}[1]{\ensuremath{#1_\uparrow}} % #1 = a mode set
\newcommand{\functionalmodeindex}{\textrm{func}}
\newcommand{\virtualmodeindex}{\textrm{virt}}
\newcommand{\implementedmodeindex}{\textrm{impl}}
\newcommand{\functionalmodes}{\ensuremath{\modes^\functionalmodeindex}}
\newcommand{\virtualmodes}{\ensuremath{\modes^\virtualmodeindex}}
\newcommand{\implementedmodes}{\ensuremath{\modes^\implementedmodeindex}}
\newcommand{\mandatorymodeindex}{\textrm{mand}}
\newcommand{\mandatorymodes}{\ensuremath{\modes^\mandatorymodeindex}}
%\newcommand{\allowedmodes}{\ensuremath{\mathcal{M}_\textrm{allowed}}}
%\newcommand{\disallowedmodes}{\ensuremath{\mathcal{M}_\textrm{disallowed}}}
%\newcommand{\configuredmodes}{\ensuremath{\mathcal{M}_\textrm{conf}}}
%\newcommand{\configurationmapping}{\ensuremath{\kappa}}
\newcommand{\mem}{{\ensuremath{\textsf{mem}}}}
\newcommand{\modememreq}[2]{\ensuremath{\mem_{#2}^{#1}}} % #1=mode, #2=node
\newcommand{\maxmemory}{\ensuremath{\mem^\textrm{max}}}
%\newcommand{\modeimprovementfactor}{\ensuremath{\lambda^\textrm{min}}}
\newcommand{\modeimprovementfactor}{\ensuremath{\lambda}}
%\newcommand{\modeedges}{\ensuremath{\mathcal{E}}}
\newcommand{\modeedges}{\ensuremath{\mathbf{\Xi}}}
\newcommand{\immediatemodeedges}[1]{\ensuremath{\modeedges(#1)}}
\newcommand{\edgestovisit}{\texttt{edges}}
%\newcommand{\modecostreldiff}[2]{\ensuremath{\Delta \controlcost_{#2 \rightarrow #1}}}
\newcommand{\modecostreldiff}[2]{\ensuremath{\Delta \controlcost^{#1} (#2)}} % Arg1 is the supermode implementation and Arg2 is the actual mode
\newcommand{\modecostreduction}[1]{\ensuremath{\Delta \controlcost^{#1}}}
\newcommand{\modecost}[1]{\ensuremath{\controlcost^{#1}}}
\newcommand{\modecostwithsupermode}[2]{\ensuremath{\controlcost^{#1}(#2)}}
\newcommand{\modeselectvar}{\ensuremath{b}}
\newcommand{\controlcostallmodes}[1]{\ensuremath{\controlcost_\textrm{tot}^{(#1)}}} % #1=modeimprovementfactor
\newcommand{\topmodescost}{\ensuremath{\controlcost_\textrm{tot}^\uparrow}}


% Other
\newcommand{\eclipse}{ECL$^i$PS$^e$}


% Self-triggered control
\newcommand{\deadline}{\ensuremath{d}}

%\usepackage{skull}
%\renewcommand{\deadline}{\ensuremath{\skull}}

\newcommand{\starttime}{\ensuremath{t}}
\newcommand{\goldensectionstarttimes}{\ensuremath{\mathbf{\Omega}}}
\newcommand{\goldensectionstarttime}{\ensuremath{\mathbf{\omega}}}
\newcommand{\candidatestarttime}[1]{\ensuremath{\starttime^{(#1)}}}
\newcommand{\candidatestarttimes}{\ensuremath{\mathbf{t}^\textsf{cand}}}
\renewcommand{\candidatestarttimes}{\ensuremath{\mathbf{\Xi}}}
\newcommand{\schedulablecandidatestarttimes}{\ensuremath{\mathbf{t}^\textsf{sched}}}
\renewcommand{\schedulablecandidatestarttimes}{\ensuremath{\mathbf{\Xi}^\prime}}
\newcommand{\starttimechange}{\ensuremath{\Delta}}
\newcommand{\currenttime}{\ensuremath{\phi}}

\newcommand{\cost}{\ensuremath{J}}
\newcommand{\statecost}{\ensuremath{\cost}^\textrm{x}}
\newcommand{\statecostapprox}{\ensuremath{\approximation{\cost}^\textrm{x}}}
\newcommand{\minstatecost}{\ensuremath{\cost}^\textrm{x,min}}
\newcommand{\minapproxstatecost}{\ensuremath{\approximation{\cost}}^\textrm{x,min}}
\newcommand{\maxstatecost}{\ensuremath{\cost}^\textrm{x,max}}
\newcommand{\maxapproxstatecost}{\ensuremath{\approximation{\cost}}^\textrm{x,max}}
\newcommand{\normalizedstatecost}{\ensuremath{\cost}^\textrm{c}}
\newcommand{\normalizedstatecostapprox}{\ensuremath{\approximation{\cost}}^\textrm{c}}

\newcommand{\resourcecost}{\ensuremath{\cost}^\textrm{r}}
%\newcommand{\cpucost}{\ensuremath{\cost}^\textrm{cpu}}
\newcommand{\cpucost}{\resourcecost}
\newcommand{\costtradeoff}{\ensuremath{\rho}}
\newcommand{\schedulerealizationcost}{\ensuremath{\widetilde{\cost}}}
\renewcommand{\schedulerealizationcost}{\ensuremath{\Psi}}

\newcommand{\simcontrolcost}{\ensuremath{\cost}^\textrm{c,sim}}
\newcommand{\simperiodiccontrolcost}{\ensuremath{\simcontrolcost_\textrm{per}}}
\newcommand{\simtime}{\ensuremath{t}^\textrm{sim}}



% Fault-tolerant distributed control 
\newcommand{\nodeconfig}{\ensuremath{\mathbf{X}}}
\newcommand{\configurationset}{\ensuremath{\mathcal{X}}}
\newcommand{\feasibleconfigset}{\ensuremath{\configurationset^{\textrm{feas}}}}
\newcommand{\baseconfigset}{\ensuremath{\configurationset^{\textrm{base}}}}
\newcommand{\mappinglimitation}{\ensuremath{\Pi}}
\newcommand{\migrationtime}{\ensuremath{\mu}}
\newcommand{\migrationtimemax}{\ensuremath{\migrationtime}^\textrm{max}}
\newcommand{\maximumnodefailures}{\ensuremath{\eta}}
\newcommand{\minimumavailablenodes}{\ensuremath{\kappa}}
\newcommand{\mappedconfigset}{\ensuremath{\configurationset^{\textrm{map}}}}
\newcommand{\migrationconfigset}{\ensuremath{\configurationset^{\textrm{migr}}}}
\newcommand{\memoryconfigset}{\ensuremath{\configurationset^{\textrm{mem}}}}
\newcommand{\storedtasks}{\ensuremath{\mathbf{\Xi}}}
\newcommand{\selectedtaskstostore}{\ensuremath{\mathbf{S}}}
\newcommand{\migratedtasks}{\ensuremath{\mathbf{\Psi}}}
\newcommand{\failureprob}{\ensuremath{p}}
\newcommand{\taskboolean}{\ensuremath{b}}
\newcommand{\configconstruct}{\ensuremath{\textsf{construct}}}
\newcommand{\feasibleconstruct}{\ensuremath{\textsf{feasible}}}
